<%@ page contentType="text/html; charset=UTF-8"%>
<%@ include file="/commons/taglibs.jsp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title></title>
</head>
<link href="${ctx}/css/main/base.css" rel="stylesheet" type="text/css"/>
<link href="${ctx}/css/main/main.css" rel="stylesheet" type="text/css"/>

<body class="m_6" style="over" onload="errInfo();">
<form name="ListF" method="post">
<div id="main">
<input type="hidden" name="info" id="info" value="${info}"/>
	<div class="zdsz" id="select1">
		<div class="tab"><h3 class="sel" onclick="f1();">管理资源</h3><h3 onclick="f2();">新建资源</h3><h3 onclick="f3();">设置禁用资源</h3><h3 id="err"></h3> </div>
		<div class="zd_gut">
		<ul class="block">
		<li>
				<table width="70%" border="0" cellspacing="0" cellpadding="0" class="tab_1 center" align="center">
				  <tr>
					<td class="bg4">序号</td>
					<td class="bg4">功能点</td>
					<td class="bg4">资源名称</td>
					<td class="bg4">操作</td>
				  </tr>
				 <s:iterator value="pageData.data" status="asset" id="asset1">
				  <tr>
					<td>${asset1[1].assetOrder}</td>
					<td>${asset1[0]}</td>
					<td>${asset1[1].assetName}</td>
					<td><a href="${ctx}/asset/asset!preModifySysAsset.action?sysAsset.assetId=${asset1[1].assetId}">编辑</a>　<a href="#" onclick="deleteAsset('${asset1[1].assetId}');">删除</a></td>
				  </tr>
				 </s:iterator>
				</table>
				<table width="70%" border="0" cellspacing="0" cellpadding="0" class="tab_1 center" align="center">
				  <tr>
				    <input type="hidden" value="<s:property value="pageData.page" />" name="pageData.page" id="page" />
				    <td align="center">共
								<s:property value="pageData.total" />
								条信息 每页
								<s:property value="pageData.size" />
								条 当前
								<s:property value="pageData.page" />
								/共
								<s:property value="pageData.totalPageCount" />
								页</td>
				    <td align="center">&lt;&lt;
								<a href="javascript:document.getElementById('page').value=1;MM_list();">首页</a>&nbsp;&nbsp;
								<s:if test="pageData.page >1 ">
									<a
										href="javascript:document.getElementById('page').value=parseInt(document.getElementById('page').value)-1;MM_list();">上一页</a>&nbsp;&nbsp;
				      </s:if>
								<s:if
									test="pageData.page < pageData.totalPageCount">
									<a
										href="javascript:document.getElementById('page').value=parseInt(document.getElementById('page').value)+1;MM_list();">下一页</a>&nbsp;&nbsp;
				      </s:if>
								<a
									href="javascript:<s:if test="#request.page.totalPageCount > 0">document.getElementById('page').value=<s:property value="#request.page.totalPageCount"/></s:if>;MM_list();">末页</a>
								&gt;&gt;</td>
				  </tr>
				</table>
		</li>
		</ul>
		<div class="bihe"></div>
		</div>
	</div>
</div>
</form>
</body>
</html>
<script type="text/javascript">

	function MM_list(){
		document.ListF.action="${ctx}/asset/asset!index.action";
		document.ListF.submit();
	
	}

	function deleteAsset(str){
		if(window.confirm("确定要删除该资源?")){
			window.location = "${ctx}/asset/asset!deleteSysAsset.action?sysAsset.assetId="+str;
		}
	}
	
	function f1(){
		document.ListF.action="${ctx}/asset/asset!index.action";
		document.ListF.submit();
	}
	
	
	function f2(){
		window.location = "${ctx}/asset/asset!preCreateSysAsset.action";
	}
	function f3(){
		window.location = "${ctx}/asset/asset!preSetAssetIdGroup.action";
	}
	
	function errInfo(){
	
		var info = document.getElementById("info").value;
		
		if(info == 'asset_1'){
		   document.getElementById("err").innerHTML ="<font color='red'>成功!</div>";
		   
		}else if(info == 'asset_2'){
			document.getElementById("err").innerHTML ="<font color='red'>请选择功能点!</div>";
		}else if(info == 'asset_3'){
			document.getElementById("err").innerHTML ="<font color='red'>资源名称不能为空!</div>";
		}else if(info == 'asset_4'){
			document.getElementById("err").innerHTML ="<font color='red'>资源英文名称不能为空!</div>";
		}else if(info == 'asset_5'){
			document.getElementById("err").innerHTML ="<font color='red'>资源链接不能为空!</div>";
		}else if(info == 'asset_0'){
			document.getElementById("err").innerHTML ="<font color='red'>失败!</div>";
		}
	}
</script>
